package com.ita.fileutil;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;

public class GenFile {
	
	public static void main(String[] args) throws FileNotFoundException, IOException {
		Run.genFile();
	}

}
class Run{	
	public static void genFile() throws FileNotFoundException, IOException  {
		ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream("./files/students.txt"));
		Student student;
		for (int i = 0; i < 100000; i++) {
			student = new Student("name" + i, i, i+i);
			System.out.println("student : " + student.getSname() + " " + student.getNum());
			objectOutputStream.writeObject(student);
		}
		objectOutputStream.close();
		System.out.println("End ....");
	}
} 
